*****************************************************************
* Local Partisan Biases in Allocations of Foreign Aid: 
* A Study of Agricultural Assistance in India
*
* Brian Min, Eugenio Arima, David Backer, Allen Hicken, Ken Kollman, and Joel Selway 
* World Politics, 2023 no. 1
*
*
* DISTRICT-LEVEL SPATIAL ANALYSIS
* Replication code for: 
* Table 7
*
* Rev 7 July 2022
*****************************************************************

*******************************************
* TABLE 7
* Spatial Models of Agricultural Aid Allocation (District-Level)


set more off
clear all

use "DIST_India_AgAid_ts_20190724_balanced_nomiss_v15_W", clear
* Use Wd05 contiguity matrix
spmatrix use Wd using Wd05.stswm, replace
* Hard code year dummies
tabulate year, gen(yeard)

	
* Model 1 SEM
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_align_both yeard2-yeard14,  errorlag(Wd) fe

* Model 2 SEM
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce l_align_both  yeard2-yeard14, errorlag(Wd) fe
	
* Model 3 SEM
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce l_align_both l_bjp l_cp l_othp yeard2-yeard14, errorlag(Wd) fe
	
* Model 4 GNS
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_align_both yeard2-yeard14,  dvarlag(Wd) errorlag(Wd) ivarlag(Wd:  l_c3_pct l_c4_pct l_SPI12m l_align_both) fe

* Model 5 GNS
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce l_align_both  yeard2-yeard14,  ///
	dvarlag(Wd) errorlag(Wd) ivarlag(Wd:  l_c3_pct l_c4_pct l_SPI12m l_electionyear ///
	l_turnout l_mov l_align_st l_align_ce l_align_both) fe
	
* Model 6 GNS
spxtregress project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov ///
	l_align_st l_align_ce l_align_both  l_bjp l_cp l_othp yeard2-yeard14,  ///
	dvarlag(Wd) errorlag(Wd) ivarlag(Wd:  l_c3_pct l_c4_pct l_SPI12m l_electionyear ///
	l_turnout l_mov l_align_st l_align_ce l_align_both  l_bjp l_cp l_othp ) fe
	
* Model 7 Non-Spatial
xtreg project_start l_c3_pct l_c4_pct l_SPI12m l_align_both i.year, fe

* Model 8 Non-Spatial
xtreg project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov l_align_st l_align_ce l_align_both i.year, fe

* Model 9 Non-Spatial		
xtreg project_start l_c3_pct l_c4_pct l_SPI12m l_electionyear l_turnout l_mov l_align_st l_align_ce l_align_both l_bjp l_cp l_othp i.year, fe

		
		
		
		
		
